我在我的持久功能应用程序中有断断续续的凭证问题。
ManagedIdentityCredential will use App Service managed identity
EnvironmentCredential.get_token failed: EnvironmentCredential authentication unavailable. Environment variables are not fully configured.
DefaultAzureCredential - EnvironmentCredential is unavailable在我称之为DefaultAzureCredential的每一个活动中
# some activity function
from azure.identity import DefaultAzureCredential
credential = DefaultAzureCredential()
def my_func()...在我的策划者中创建一张证书,并把它传递给我的活动,会更好吗?我也在使用系统分配的标识,所以我应该使用ManagedIdentityCredential来避免DefaultAzureCredential所做的常量检查吗?
from azure.identity import ManagedIdentityCredential
import azure.durable_functions as df
def orchestrator_function(context: df.DurableOrchestrationContext):
# Create the credentials
credentials = ManagedIdentityCredential()
# Pass it to my activity instead of my activity creating its own
activity = yield context.call_activity("my_activity", credentials)发布于 2021-02-02 09:02:11
在我的策划者中创建一张证书,并把它传递给我的活动,会更好吗?
根据我的理解,如果您的Orchestrator function多次调用Activity function,最好在Orchestrator function中传递Credential;如果只调用一次,我认为在Activity function中创建Credential是一样的。
我也在使用系统分配的标识,所以我应该使用ManagedIdentityCredential来避免DefaultAzureCredential所做的常量检查吗?
如果使用System assigned identity,则可以直接使用ManagedIdentityCredential,因为DefaultAzureCredential将检查多个身份,直到其中一个提供令牌为止。
为了更好地理解,您可以参考这个正式文件。

EnvironmentCredential is unavailable是由DefaultAzureRedential未能从EnvironmentCredential请求令牌引起的,这是预期的结果。
https://stackoverflow.com/questions/66001330
复制相似问题