Ottiene il profilo VPN pregenerato per il client P2S del gateway di rete virtuale nel gruppo di risorse specificato. Il profilo deve essere generato prima usando generateVpnProfile.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl?api-version=2023-11-01
Parametri dell'URI
Nome |
In |
Necessario |
Tipo |
Descrizione |
resourceGroupName
|
path |
True
|
string
|
Nome del gruppo di risorse.
|
subscriptionId
|
path |
True
|
string
|
Credenziali della sottoscrizione che identificano in modo univoco la sottoscrizione di Microsoft Azure. L'ID sottoscrizione fa parte dell'URI per ogni chiamata al servizio.
|
virtualNetworkGatewayName
|
path |
True
|
string
|
Nome del gateway di rete virtuale.
|
api-version
|
query |
True
|
string
|
Versione dell'API client.
|
Risposte
Nome |
Tipo |
Descrizione |
200 OK
|
string
|
URL del pacchetto del profilo VPN.
|
202 Accepted
|
|
Accettato e l'operazione verrà completata in modo asincrono.
|
Other Status Codes
|
CloudError
|
Risposta di errore che descrive il motivo per cui l'operazione non è riuscita.
|
Sicurezza
azure_auth
Flusso OAuth2 di Azure Active Directory.
Tipo:
oauth2
Flow:
implicit
URL di autorizzazione:
https://login.microsoftonline.com/common/oauth2/authorize
Ambiti
Nome |
Descrizione |
user_impersonation
|
rappresentare l'account utente
|
Esempio
GetVirtualNetworkGatewayVPNProfilePackageURL
Esempio di richiesta
POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/getvpnprofilepackageurl?api-version=2023-11-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python virtual_network_gateway_get_vpn_profile_package_url.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.virtual_network_gateways.begin_get_vpn_profile_package_url(
resource_group_name="rg1",
virtual_network_gateway_name="vpngw",
).result()
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-11-01/examples/VirtualNetworkGatewayGetVpnProfilePackageUrl.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f4c6c8697c59f966db0d1e36b62df3af3bca9065/specification/network/resource-manager/Microsoft.Network/stable/2023-11-01/examples/VirtualNetworkGatewayGetVpnProfilePackageUrl.json
func ExampleVirtualNetworkGatewaysClient_BeginGetVPNProfilePackageURL() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetVPNProfilePackageURL(ctx, "rg1", "vpngw", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Value = ""
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.
*
* @summary Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-11-01/examples/VirtualNetworkGatewayGetVpnProfilePackageUrl.json
*/
async function getVirtualNetworkGatewayVpnProfilePackageUrl() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const virtualNetworkGatewayName = "vpngw";
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.virtualNetworkGateways.beginGetVpnProfilePackageUrlAndWait(
resourceGroupName,
virtualNetworkGatewayName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Risposta di esempio
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/locations/eastus/operations/00000000-0000-0000-0000-000000000000?api-version=2023-11-01
""
Definizioni
CloudError
Risposta di errore dal servizio.
CloudErrorBody
Risposta di errore dal servizio.
Nome |
Tipo |
Descrizione |
code
|
string
|
Identificatore dell'errore. I codici sono invarianti e devono essere utilizzati a livello di codice.
|
details
|
CloudErrorBody[]
|
Elenco di dettagli aggiuntivi sull'errore.
|
message
|
string
|
Messaggio che descrive l'errore, destinato a essere adatto per la visualizzazione in un'interfaccia utente.
|
target
|
string
|
Destinazione dell'errore specifico. Ad esempio, il nome della proprietà in errore.
|