Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
Met deze taak worden toepassingen geïmplementeerd in Azure Spring Apps en worden deze implementaties beheerd.
Belangrijk
Deze taak wordt ondersteund in Azure Spring Apps Basic-/Standard- en Enterprise-abonnementen. Zie Toepassingsimplementaties automatiseren naar Azure Spring Apps voor meer informatie.
Syntaxis
# Azure Spring Apps v0
# Deploy applications to Azure Spring Apps and manage deployments.
- task: AzureSpringCloud@0
inputs:
azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription.
Action: 'Deploy' # 'Deploy' | 'Set Production' | 'Delete Staging Deployment'. Required. Action. Default: Deploy.
AzureSpringCloud: # string. Required. Azure Spring Apps Name.
AppName: # string. Required. App.
#DeploymentType: 'Artifacts' # 'Artifacts' | 'CustomContainer'. Optional. Use when Action = Deploy. Deployment Type. Default: Artifacts.
#UseStagingDeployment: true # boolean. Optional. Use when Action = Deploy || Action = Set Production. Use Staging Deployment. Default: true.
#CreateNewDeployment: false # boolean. Optional. Use when Action = Deploy && UseStagingDeployment = false. Create a new staging deployment if one does not exist. Default: false.
#DeploymentName: # string. Optional. Use when UseStagingDeployment = false && Action != Delete Staging Deployment. Deployment.
#Package: '$(System.DefaultWorkingDirectory)/**/*.jar' # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.jar.
#RegistryServer: 'docker.io' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Server. Default: docker.io.
#RegistryUsername: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Username.
#RegistryPassword: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Password.
#ImageName: 'hello-world:v1' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Name and Tag. Default: hello-world:v1.
#ImageCommand: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Command.
#ImageArgs: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Arguments.
#ImageLanguageFramework: # 'springboot'. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Language Framework.
# Application and Configuration Settings
#Builder: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Builder.
#EnvironmentVariables: # string. Optional. Use when Action = Deploy. Environment Variables.
#JvmOptions: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. JVM Options.
#RuntimeVersion: 'Java_11' # 'Java_8' | 'Java_11' | 'Java_17' | 'Java_21' | 'NetCore_31'. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Runtime Version. Default: Java_11.
#DotNetCoreMainEntryPath: # string. Optional. Use when RuntimeVersion = NetCore_31. Main Entry Path.
#Version: # string. Optional. Use when Action = Deploy. Version.
# Azure Spring Apps v0
# Deploy applications to Azure Spring Apps and manage deployments.
- task: AzureSpringCloud@0
inputs:
azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription.
Action: 'Deploy' # 'Deploy' | 'Set Production' | 'Delete Staging Deployment'. Required. Action. Default: Deploy.
AzureSpringCloud: # string. Required. Azure Spring Apps Name.
AppName: # string. Required. App.
#DeploymentType: 'Artifacts' # 'Artifacts' | 'CustomContainer'. Optional. Use when Action = Deploy. Deployment Type. Default: Artifacts.
#UseStagingDeployment: true # boolean. Optional. Use when Action = Deploy || Action = Set Production. Use Staging Deployment. Default: true.
#CreateNewDeployment: false # boolean. Optional. Use when Action = Deploy && UseStagingDeployment = false. Create a new staging deployment if one does not exist. Default: false.
#DeploymentName: # string. Optional. Use when UseStagingDeployment = false && Action != Delete Staging Deployment. Deployment.
#Package: '$(System.DefaultWorkingDirectory)/**/*.jar' # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.jar.
#RegistryServer: 'docker.io' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Server. Default: docker.io.
#RegistryUsername: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Username.
#RegistryPassword: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Password.
#ImageName: 'hello-world:v1' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Name and Tag. Default: hello-world:v1.
#ImageCommand: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Command.
#ImageArgs: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Arguments.
#ImageLanguageFramework: # 'springboot'. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Language Framework.
# Application and Configuration Settings
#Builder: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Builder.
#EnvironmentVariables: # string. Optional. Use when Action = Deploy. Environment Variables.
#JvmOptions: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. JVM Options.
#RuntimeVersion: 'Java_11' # 'Java_8' | 'Java_11' | 'NetCore_31'. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Runtime Version. Default: Java_11.
#DotNetCoreMainEntryPath: # string. Optional. Use when RuntimeVersion = NetCore_31. Main Entry Path.
#Version: # string. Optional. Use when Action = Deploy. Version.
# Azure Spring Apps v0
# Deploy applications to Azure Spring Apps and manage deployments.
- task: AzureSpringCloud@0
inputs:
azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription.
Action: 'Deploy' # 'Deploy' | 'Set Production' | 'Delete Staging Deployment'. Required. Action. Default: Deploy.
AzureSpringCloud: # string. Required. Azure Spring Apps Name.
AppName: # string. Required. App.
#UseStagingDeployment: true # boolean. Optional. Use when Action = Deploy || Action = Set Production. Use Staging Deployment. Default: true.
#CreateNewDeployment: false # boolean. Optional. Use when Action = Deploy && UseStagingDeployment = false. Create a new staging deployment if one does not exist. Default: false.
#DeploymentName: # string. Optional. Use when UseStagingDeployment = false && Action != Delete Staging Deployment. Deployment.
#Package: '$(System.DefaultWorkingDirectory)/**/*.jar' # string. Optional. Use when Action = Deploy. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.jar.
# Application and Configuration Settings
#EnvironmentVariables: # string. Optional. Use when Action = Deploy. Environment Variables.
#JvmOptions: # string. Optional. Use when Action = Deploy. JVM Options.
#RuntimeVersion: 'Java_11' # 'Java_8' | 'Java_11' | 'NetCore_31'. Optional. Use when Action = Deploy. Runtime Version. Default: Java_11.
#DotNetCoreMainEntryPath: # string. Optional. Use when RuntimeVersion = NetCore_31. Main Entry Path.
#Version: # string. Optional. Use when Action = Deploy. Version.
Invoer
azureSubscription
-
Azure-abonnement
Invoeralias: ConnectedServiceName.
string. Verplicht.
Hiermee geeft u het Azure Resource Manager-abonnement op voor de implementatie.
Action
-
actie-
string. Verplicht. Toegestane waarden: Deploy, ( Set Production Productie-implementatie instellen), Delete Staging Deployment. Standaardwaarde: Deploy.
De actie die moet worden uitgevoerd op Azure Spring Apps.
AzureSpringCloud
-
Naam van Azure Spring-apps
string. Verplicht.
De naam of resource-id van het Azure Spring Apps-exemplaar dat moet worden geïmplementeerd.
AppName
-
App
string. Verplicht.
De naam van de Azure Spring Apps-app die moet worden geïmplementeerd. De app moet bestaan voordat de taak wordt uitgevoerd.
DeploymentType
-
Type implementatie
string. Facultatief. Gebruiken wanneer Action = Deploy. Toegestane waarden: Artifacts, CustomContainer (Aangepaste container). Standaardwaarde: Artifacts.
Om te implementeren met broncode of Java-pakket, kiest u "Artefacten"; Als u wilt implementeren met een containerinstallatiekopie, kiest u "Aangepaste container".
UseStagingDeployment
-
Implementatie van fasering gebruiken
boolean. Facultatief. Gebruiken wanneer Action = Deploy || Action = Set Production. Standaardwaarde: true.
Op het moment dat de taak wordt uitgevoerd, selecteert deze invoer automatisch de implementatie die is ingesteld als staging.
Als deze is ingesteld op true, past u de taak toe op de implementatie die is ingesteld als de faseringsimplementatie op het moment van uitvoering. Als deze optie wordt weggelaten, moet de DeploymentName parameter worden ingesteld.
CreateNewDeployment
-
Maak een nieuwe faseringsimplementatie als deze nog niet bestaat.
boolean. Facultatief. Gebruiken wanneer Action = Deploy && UseStagingDeployment = false. Standaardwaarde: false.
Als deze is ingesteld op true, en de implementatie die is opgegeven door DeploymentName bestaat niet op het moment van uitvoering, wordt deze gemaakt. Als deze optie wordt weggelaten, moet de DeploymentName parameter worden ingesteld.
DeploymentName
-
Implementatie
string. Facultatief. Gebruiken wanneer UseStagingDeployment = false && Action != Delete Staging Deployment.
De implementatie waarop deze taak van toepassing zal zijn. Als u geen blauw-groene implementaties gebruikt, stelt u dit veld in op default. De waarde moet beginnen met een letter en alleen uit kleine letters en cijfers bestaan.
Package
-
pakket of map
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = Artifacts. Standaardwaarde: $(System.DefaultWorkingDirectory)/**/*.jar.
Het bestandspad naar het pakket of de map met de inhoud van de Azure Spring Apps-app (.jar bestand voor Java, .zip voor .NET Core).
Variabelen (buildrelease | ) en jokertekens worden ondersteund.
Bijvoorbeeld $(System.DefaultWorkingDirectory)/**/*.jar
Package
-
pakket of map
string. Facultatief. Gebruiken wanneer Action = Deploy. Standaardwaarde: $(System.DefaultWorkingDirectory)/**/*.jar.
Het bestandspad naar het pakket of de map met de inhoud van de Azure Spring Apps-app (.jar bestand voor Java, .zip voor .NET Core).
Variabelen (buildrelease | ) en jokertekens worden ondersteund.
Bijvoorbeeld $(System.DefaultWorkingDirectory)/**/*.jar
Builder
-
Bouwer
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = Artifacts.
Selecteer een bouwer van VMware Tanzu® Build Service™, dit kan worden gebruikt in de enterprise-laag.
Voor een gedetailleerde beschrijving, zie Gebruik Tanzu Build Service.
RegistryServer
-
Registerserver
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = CustomContainer. Standaardwaarde: docker.io.
Het register van de containerinstallatiekopieën. Standaardinstelling: docker.io.
RegistryUsername
-
Gebruikersnaam van het register
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = CustomContainer.
De gebruikersnaam van het containerregister.
RegistryPassword
-
registerwachtwoord
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = CustomContainer.
Het wachtwoord van het containerregister.
ImageName
-
Naam en tag van de afbeelding
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = CustomContainer. Standaardwaarde: hello-world:v1.
De containerinstallatiekopieëntag.
ImageCommand
-
Afbeelding Opdracht
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = CustomContainer.
De opdracht van de containerinstallatiekopieën.
ImageArgs
-
Afbeelding Argumenten
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = CustomContainer.
De argumenten van de containerinstallatiekopieën.
ImageLanguageFramework
-
Taal Raamwerk
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = CustomContainer. Toegestane waarden: springboot.
EnvironmentVariables
-
omgevingsvariabelen
string. Facultatief. Gebruiken wanneer Action = Deploy.
De omgevingsvariabelen die moeten worden ingevoerd met behulp van de syntaxis -key value (bijvoorbeeld: -CUSTOMER_NAME Contoso-WEBSITE_TIME_ZONE). Waarden die spaties bevatten, moeten tussen dubbele aanhalingstekens worden geplaatst (bijvoorbeeld: "Eastern Standard Time").
JvmOptions
-
JVM-opties
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = Artifacts.
Hiermee bewerkt u de JVM-opties van de app. Een tekenreeks met JVM-opties, zoals -Xms1024m -Xmx2048m.
JvmOptions
-
JVM-opties
string. Facultatief. Gebruiken wanneer Action = Deploy.
Hiermee bewerkt u de JVM-opties van de app. Een tekenreeks met JVM-opties, zoals -Xms1024m -Xmx2048m.
RuntimeVersion
-
Runtime-versie
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = Artifacts. Toegestane waarden: Java_8 (Java 8), Java_11 (Java 11), Java_17 (Java 17), Java_21 (Java 21), NetCore_31 (.Net Core 3.1). Standaardwaarde: Java_11.
De runtime-versie waarop de app wordt uitgevoerd.
RuntimeVersion
-
Runtime-versie
string. Facultatief. Gebruiken wanneer Action = Deploy && DeploymentType = Artifacts. Toegestane waarden: Java_8 (Java 8), Java_11 (Java 11), NetCore_31 (.Net Core 3.1). Standaardwaarde: Java_11.
De runtime-versie waarop de app wordt uitgevoerd.
RuntimeVersion
-
Runtime-versie
string. Facultatief. Gebruiken wanneer Action = Deploy. Toegestane waarden: Java_8 (Java 8), Java_11 (Java 11), NetCore_31 (.Net Core 3.1). Standaardwaarde: Java_11.
De runtime-versie waarop de app wordt uitgevoerd.
DotNetCoreMainEntryPath
-
Hoofd ingangspad
string. Facultatief. Gebruiken wanneer RuntimeVersion = NetCore_31.
Het pad naar het uitvoerbare bestand .NET ten opzichte van de zip-root.
Version
-
versie
string. Facultatief. Gebruiken wanneer Action = Deploy.
De implementatieversie. Als dit niet is ingesteld, blijft de versie ongewijzigd.
Opties voor taakbeheer
Alle taken hebben besturingsopties naast hun taakinvoer. Zie Opties en algemene taakeigenschappenvoor meer informatie.
Uitvoervariabelen
Deze taak definieert de volgende uitvoervariabelen, die u kunt gebruiken in downstreamstappen, taken en fasen.
testEndpoint
Alleen na de actie 'Implementeren'. Bevat een privé-URL voor toegang tot de bijgewerkte implementatie.
Opmerkingen
Gebruik deze taak om toepassingen te implementeren in Azure Spring Apps en om Azure Spring Cloud-implementaties te beheren.
Belangrijk
Deze taak wordt ondersteund in Azure Spring Apps Basic-/Standard- en Enterprise-abonnementen. Zie Toepassingsimplementaties automatiseren naar Azure Spring Apps voor meer informatie.
Voorbeelden
In de volgende voorbeelden ziet u veelvoorkomende gebruiksscenario's. Zie Toepassingsimplementaties automatiseren naar Azure Spring Apps voor meer informatie.
Een faseringsimplementatie verwijderen
Met de actie 'Staging-implementatie verwijderen' kunt u de implementatie verwijderen die geen productieverkeer ontvangt. Hierdoor worden resources vrijgemaakt die door die implementatie worden gebruikt en wordt er ruimte gemaakt voor een nieuwe faseringsimplementatie:
variables:
azureSubscription: Contoso
steps:
- task: AzureSpringCloud@0
continueOnError: true # Don't fail the pipeline if a staging deployment doesn't already exist.
inputs:
continueOnError: true
inputs:
azureSubscription: $(azureSubscription)
Action: 'Delete Staging Deployment'
AppName: customer-api
AzureSpringCloud: contoso-dev-az-spr-cld
Implementeren
Naar productie
In het volgende voorbeeld wordt geïmplementeerd in de standaardproductie-implementatie in Azure Spring Apps. Dit is het enige mogelijke implementatiescenario bij gebruik van de basis-SKU:
Opmerking
Het pakketzoekpatroon mag slechts precies één pakket retourneren. Als de buildtaak meerdere JAR-pakketten produceert, zoals sources.jar en javadoc.jar, moet u het zoekpatroon verfijnen zodat het alleen overeenkomt met het binaire artefact van de toepassing.
variables:
azureSubscription: Contoso
steps:
- task: AzureSpringCloud@0
inputs:
azureSubscription: $(azureSubscription)
Action: 'Deploy'
AzureSpringCloud: contoso-dev-az-spr-cld
AppName: customer-api
UseStagingDeployment: false
DeploymentName: default
Package: '$(System.DefaultWorkingDirectory)/**/*customer-api*.jar'
Blauw-groen
In het volgende voorbeeld wordt geïmplementeerd in een reeds bestaande faseringsimplementatie. Deze implementatie ontvangt geen productieverkeer totdat deze is ingesteld als een productie-implementatie.
variables:
azureSubscription: Contoso
steps:
- task: AzureSpringCloud@0
inputs:
azureSubscription: $(azureSubscription)
Action: 'Deploy'
AzureSpringCloud: contoso-dev-az-spr-cld
AppName: customer-api
UseStagingDeployment: true
Package: '$(System.DefaultWorkingDirectory)/**/*customer-api*.jar'
Voor meer informatie over blauw-groene implementaties, inclusief een alternatieve aanpak, zie Blauw-groene implementatiestrategieën.
Productie-implementatie instellen
In het volgende voorbeeld wordt de huidige faseringsimplementatie ingesteld als productie, waarbij effectief wordt gewisseld welke implementatie productieverkeer ontvangt.
variables:
azureSubscription: Contoso
steps:
- task: AzureSpringCloud@0
inputs:
azureSubscription: $(azureSubscription)
Action: 'Set Production'
AzureSpringCloud: contoso-dev-az-spr-cld
AppName: customer-api
UseStagingDeployment: true
Behoeften
| Voorwaarde | Beschrijving |
|---|---|
| Pijplijntypen | YAML, klassieke build, klassieke release |
| Wordt uitgevoerd op | Agent, DeploymentGroup |
| Eisen | Geen |
| Mogelijkheden | Deze taak voldoet niet aan de vereisten voor volgende taken in de taak. |
| opdrachtbeperkingen | Welke dan ook |
| variabelen instellen | Welke dan ook |
| Agentversie | 2.104.1 of hoger |
| Taakcategorie | Implementeren |