Dela via


Hämta anslutningskonfigurationer som lagts till av Service Anslut eller

Tjänst Anslut eller konfigurerar anslutningsinformation, till exempel Databas anslutningssträng, när du skapar eller uppdaterar tjänstanslutningar. När tjänstanslutningar har skapats kanske du vill skriva kod för att använda dessa anslutningskonfigurationer i kod. Den här sidan visar hur du hämtar anslutningskonfigurationer som lagts till av Service Anslut eller.

Det finns flera sätt att hämta anslutningskonfigurationer för en tjänstanslutning. Du kan hämta konfigurationsnamn för specifik måltjänsttyp från följande artiklar Integrera Azure Database for PostgreSQL med Service Anslut or.

Eller så kan du hämta anslutningskonfigurationer programmatiskt på följande sätt.

Du kan köra följande kommandon i Azure CLI(/cli/azure) för att lista konfigurationer av en tjänstanslutning.

# for Azure Web App
az webapp connection list-configuration -g <myResourceGroupName> -n <myWebAppName> --connection <myConnectionName>

# for Azure Container App
az containerapp connection list-configuration -g <myResourceGroupName> -n <myContainerAppName> --connection <myConnectionName>

# for Azure Spring App
az spring connection list-configuration --id /subscriptions/{subscription}/resourceGroups/{myResourceGroupName}/providers/Microsoft.AppPlatform/Spring/{mySpringAppName}/apps/{myAppName}/deployments/default/providers/Microsoft.ServiceLinker/linkers/{myConnectionName}

Mer information finns i följande artiklar i Azure CLI-referensdokumentationerna:

Nästa steg