Using the Azure Management Fluent Apis. I would like like to deploy an azure function including the zipped code. Is that possible? - deployment

I know how to create the app service plan . I need to be able to deploy the code and the configuration.

Yes, it is possible to create a function app using Azure Management Fluent Api.
You can use the below ifunctionapp interface to create the function app using fluent api's:
public interface IFunctionApp :
Microsoft.Azure.Management.AppService.Fluent.IWebAppBase,
Microsoft.Azure.Management.ResourceManager.Fluent.Core.IBeta,
Microsoft.Azure.Management.ResourceManager.Fluent.Core.IGroupableResource<Microsoft.Azure.Management.AppService.Fluent.IAppServiceManager,Microsoft.Azure.Management.AppService.Fluent.Models.SiteInner>,
Microsoft.Azure.Management.ResourceManager.Fluent.Core.IHasInner<Microsoft.Azure.Management.AppService.Fluent.Models.SiteInner>,
Microsoft.Azure.Management.ResourceManager.Fluent.Core.IHasManager<Microsoft.Azure.Management.AppService.Fluent.IAppServiceManager>,
Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.IRefreshable<Microsoft.Azure.Management.AppService.Fluent.IFunctionApp>,
Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.IUpdatable<Microsoft.Azure.Management.AppService.Fluent.FunctionApp.Update.IUpdate>
using the "IWithPackageUri.WithPackageUri(String) Method" by specifing the zipped packed to deploy
public Microsoft.Azure.Management.AppService.Fluent.WebDeployment.Definition.IWithExecute WithPackageUri (string packageUri);

Related

Configuration Management in AKS Deployment with Azure Pipelines for Different Environments

I have created a ASP.NET Core WebAPI and deployed in an Dev Environment (Kubernetes) using Azure Pipelines. How can I update the configuration in the pipeline if I need to publish the same API in another environment (eg. SIT). Since I have different settings/configuration for Dev and SIT environments.
Kindly guide me.
You can use release variables to do this. Feel free to reachout if you need any assistance.
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch
https://learn.microsoft.com/en-us/azure/devops/pipelines/release/?view=azure-devops#how-do-i-specify-variables-i-want-to-edit-when-a-release-is-created
The problem occurs when I want to deploy the same API to other
environments like QA/UAT/Prod. Since each environment is having
separate databases
For this issue , there are several ways to achieve this. You can add Replace Tokens extension to the job to replace the database connection string in appsettings.json.
You can define your variable like below:
{
"ConnectionStrings": {
"DefaultConnection": "#{connectstring}#"
}
}
You can refer to this case and lab for details.
Here are some reference for the same issue:
Replacing database connection strings in the Docker image
Set Json Property task to replace the ConnectionStrings

Use AWS Amplify and App Sync with existing Node Server using Mongodb

Currently, I'm developing a native application using React-Native. I've decided to go with AWS Amplify because of it's real time updates as well as its authentication.
I also have a Web Application that runs on a Node.js with Epxress server. This web application connects to a Mongo database.
My big problem is that I would like to have all of my aws amplify queries run to my existing MongoDb instead of a new dynamoDb database which is provided with AWS AppSync, but unfortunately I dont know where to start. This is especially helpful in adding authentication easily in my existing web application as well.
My first idea was to just create all my API endpoints in a new node js server and have app sync call to these API end points, but I'm not sure how to implement calling end points on an existing server (and this seems kind of counter intuitive to the 'serverless' idea)
My other idea came from this: Can AWS App-Sync be used without dynamoDB
This states to use AWS Lambda to 'pipeline' my data to the existing mongodb, but I'm not really sure what that entails.
TL;DR - I would like to be able to query an existing Mongodb instead of using DynamoDb when using AWS Amplify with AppSync.
I hope this is clear enough and doesn't sound like I'm rambling. Thanks in advance!
I would suggest using either an HTTP datasource to connect to your MongoDB backend or a Lambda function. Here are a couple getting started tutorials for both:
https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-http-resolvers.html
https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-lambda-resolvers.html
If you go the Lambda route, then you can leverage the new #function feature of the GraphQL Transformer in the Amplify CLI: https://aws-amplify.github.io/docs/cli/graphql#function

Application Insights with ServiceFabric StatefulServices and .Net Core 2.1

i have an ServiceFabric StatefulService with Remoting inside a ServiceFabric Solution which also contains a Stateless WebApi and want to use Application Insights for monitoring this service. The WebApi uses already AI and it works fine.
I tried this in a dummy project an everything works fine with configuring AI in the constructor of the service:
public ReliableService(StatefulServiceContext context) : base(context)
{
var instrumentationKey = "myIKey";
TelemetryConfiguration.Active.TelemetryInitializers.Add(
FabricTelemetryInitializerExtension.CreateFabricTelemetryInitializer(this.Context)
);
_telemetryClient = new Microsoft.ApplicationInsights.TelemetryClient { InstrumentationKey = instrumentationKey };
TelemetryConfiguration.Active.InstrumentationKey = instrumentationKey;
TelemetryConfiguration.Active.TelemetryInitializers.Add(new OperationCorrelationTelemetryInitializer());
TelemetryConfiguration.Active.TelemetryInitializers.Add(new HttpDependenciesParsingTelemetryInitializer());
new DependencyTrackingTelemetryModule().Initialize(TelemetryConfiguration.Active);
new ServiceRemotingRequestTrackingTelemetryModule().Initialize(TelemetryConfiguration.Active);
new ServiceRemotingDependencyTrackingTelemetryModule().Initialize(TelemetryConfiguration.Active);
}
But when I copy the same code to the existing project only the WebApi sends telemetry data to AI, nothing from the statefull service.
Any idea what i'm doing wrong? The documentations are not really helpful for me, there is not full example of using AI in a statefull service with remoting.
Thank you for your answers!
You will need this package https://github.com/Microsoft/ApplicationInsights-ServiceFabric to make it work with Service Remoting.
The configuration story is very different depends on your project type, e.g, console app, Asp.Net, or Asp.Net Core. If you're on Asp.Net/Asp.Net core project, the configuration story will be better than what you have done in the dummy project.
Here is some examples that could be helpful https://github.com/yantang-msft/service-fabric-application-insights-example

jbpm 6.0.1 create process calling rest

How to create process with 1 service task - rest which calls
http://www.webservicex.net/currencyconvertor.asmx/ConversionRate?FromCurrency=EUR&ToCurrency=USD
and sets this value as parameter which can be seen later, using jbpm console(kie workbench)? JBOSS docs are mostly for user tasks.
My recommended solution is to create a new WorkItemHandler implementation that calls the web service get the results and inject that as a process variable.
You can see a similar example that calls web services here: https://github.com/droolsjbpm/jbpm-playground/tree/master/customer-relationships-workitems
HTH
There is a REST service task that you can use, available out-of-the-box in the web-based designer (under service tasks, so implemented as a custom service task). The associated handler should also be registered automatically when using the jbpm-installer:
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-installer/conf/META-INF/CustomWorkItemHandlers.conf#L4

What IOC containers work with Windows Azure

I am getting to grips with Windows Azure. I usually use NInject as my IoC container in web apps. However, when trying to use it within an Azure web role I get a security exception (something to do with reflection permission).
Has anyone used other IoC with Azure and had succcess?
I just have been prototyping with Azure services today (not Web role, though).
Autofac IoC Container for .NET has worked in this scenario.
From Ninject google group: http://groups.google.com/group/ninject/browse_thread/thread/8d5a0aff853c6b4f/20209877f8db179a?show_docid=20209877f8db179a
If you set the kernel option UseReflectionBasedInjection, Ninject will work
in Azure (as well as other partial trust environments):
var options = new KernelOptions
{
UseReflectionBasedInjection = true
};
var kernel = new StandardKernel(options, new ModuleA(), new ModuleB(), ...);