This message was deleted.
# general
s
This message was deleted.
q
Looks like updating the SDK has brought in a change in types and you're passing a string to something that doesn't expect a string
Can you share the code, that may allow us to help
b
Thank you for the insight! @quiet-wolf-18467 Sure thing! Here is the code: import pulumi from pulumi_azure import core, storage, appservice,appinsights # import pulumi_azure as azure import pulumi_azure_native.web as web from pulumi import StackReference # Create an Azure Resource Group stage=pulumi.get_stack() resource_group = core.ResourceGroup("epiic-appsvcs-rg-"+stage, name="epiic-appsvcs-rg-"+stage, location="West US") # Create an Azure resource (Storage Account) account = storage.Account("eassa"+stage, name="eassa"+stage, # The location for the storage account will be derived automatically from the resource group. resource_group_name=resource_group.name, account_tier="Standard", account_replication_type="LRS") plan = appservice.Plan("eas-asp-" + stage, name = "eas-asp-" + stage, location=resource_group.location, resource_group_name=resource_group.name, kind="linux", reserved=True, sku=appservice.PlanSkuArgs( tier="Basic", size="B1", )) insights = appinsights.Insights("eas-ai-"+stage, name = "eas-ai-" + stage, application_type = "web", location=resource_group.location, resource_group_name=resource_group.name, retention_in_days = 30 ) COSMOS_CONNECTION_STRING = os.environ['COSMOS_CONNECTION_STRING'] AzureWebJobsStorage = os.environ['AzureWebJobsStorage'] api_webapp = web.WebApp("epiic-api-" + stage, name = "epiic-api-" + stage, location=resource_group.location, resource_group_name=resource_group.name, server_farm_id=plan.id, client_affinity_enabled=False, client_cert_enabled=False, client_cert_mode="Required", container_size=0, daily_memory_time_quota=0, enabled=True, host_name_ssl_states=[ web.HostNameSslStateArgs( host_type="Standard", name="epiic-api-dev.azurewebsites.net", ssl_state="Disabled", ), web.HostNameSslStateArgs( host_type="Repository", name="epiic-api-dev.scm.azurewebsites.net", ssl_state="Disabled", ), ], host_names_disabled=False, https_only=False, hyper_v=False, is_xenon=False, kind="app,linux,container", redundancy_mode="None", reserved=True, scm_site_also_stopped=False, site_config=web.SiteConfigArgs( app_settings = [ web.NameValuePairArgs(name="WEBSITES_ENABLE_APP_SERVICE_STORAGE", value="false"), web.NameValuePairArgs(name="DOCKER_ENABLE_CI", value="true"), web.NameValuePairArgs(name="DOCKER_REGISTRY_SERVER_URL", value="https://epiicacr.azurecr.io"), web.NameValuePairArgs(name="DOCKER_REGISTRY_SERVER_USERNAME", value= "username" ), web.NameValuePairArgs(name="DOCKER_REGISTRY_SERVER_PASSWORD", value= "**********" ), web.NameValuePairArgs(name="WEBSITES_CONTAINER_START_TIME_LIMIT", value= "600" ), web.NameValuePairArgs(name="PORT", value="80") ], linux_fx_version = "DOCKER|epiicacr.azurecr.io/epiic-api:" + stage ), storage_account_required=False ) # Export the connection string for the storage account pulumi.export("connection_string", account.primary_connection_string)
q
Unfortunately this code works for me, when the environment vars AzureWebJobsStorage and COSMOS_CONNECTION_STRING exist and are simple strings
Perhaps check with
echo ${AzureWebJobsStorage} ${COSMOS_CONNECTION_STRING}
and ensure yours are strings
I'd also strongly encourage you to remove the dependency on environment variables and move this to stack configuration with
pulumi config set
b
@quiet-wolf-18467 The problem was with the environment vars. Sorry, I should have caught that. I will definitely look into using pulumi config set Thank you for your help!!!