func CreateDeployment(ctx context.Context, deploymentName string, template, params *map[string]interface{}) (de resources.DeploymentExtended, err error) {
	deployClient := getDeploymentsClient()
	future, err := deployClient.CreateOrUpdate(
		ctx,
		config.GroupName(),
		deploymentName,
		resources.Deployment{
			Properties: &resources.DeploymentProperties{
				Template:   template,
				Parameters: params,
				Mode:       resources.Incremental,
			},
		},
	)
	if err != nil {
		return de, fmt.Errorf("cannot create deployment: %v", err)
	}
	err = future.WaitForCompletionRef(ctx, deployClient.Client)
	if err != nil {
		return de, fmt.Errorf("cannot get the create deployment future respone: %v", err)
	}
	return future.Result(deployClient)
}
CreateDeployment creates a template deployment using the
referenced JSON files for the template and its parameters
package resources
import (
	"context"
	"fmt"
	"github.com/Azure-Samples/azure-sdk-for-go-samples/internal/config"
	"github.com/Azure-Samples/azure-sdk-for-go-samples/internal/iam"
	"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources"
)
func getDeploymentsClient() resources.DeploymentsClient {
	deployClient := resources.NewDeploymentsClient(config.SubscriptionID())
	a, _ := iam.GetResourceManagementAuthorizer()
	deployClient.Authorizer = a
	deployClient.AddToUserAgent(config.UserAgent())
	return deployClient
}