我的持久功能应用程序中存在间歇性凭据问题
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()...
在我的orchestrator中创建一个凭证,一次,并将其传递给我的活动是否更好?我还使用系统分配的标识,所以我应该使用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)
根据我的理解,如果您的
Orchestrator function
多次调用Activity function
,最好在Orchestrator function
中传递Credential
;如果只调用一次,我认为在Activity function
中创建Credential
也是一样的如果使用
System assigned identity
,则可以直接使用ManagedIdentityCredential
,因为DefaultAzureCredential
将检查多个标识,直到其中一个标识提供令牌为止为了更好地理解,您可以参考此official document
EnvironmentCredential is unavailable
是由于DefaultAzureRedential
未能从EnvironmentCredential
请求令牌造成的,这是预期的结果相关问题 更多 >
编程相关推荐