Azure Service Bus 1.1 Failing to Start - azure

Service Bus Gateway is not starting.
First of all I have tried completely uninstalling all Azure/Fabric/Service Bus type SDKs and installations. I have installed both Windows Azure Pack: Service Bus 1.1 and Windows Azure Pack: Security Update for Service Bus 1.1 (KB2972621) from scratch.
After deleting all service bus related databases I start the Service Bus Configuration wizard and begin starting a new farm with custom settings.
I leave everything default except adding my own certificates, and of course entering my password.
After clicking go the the service bus configuration wizard eventually gets stuck in progress:
Starting
Created and configured Service Bus farm management database.
Created and configured Service Bus gateway database.
Creating default container.
Processing completed
Validating input and configuration parameters.
Granting 'Log on as Service' privilege to the run as account.
Windows Fabric configuration started.
Running Windows Fabric deployment.
Windows Fabric starting.
Service Bus configuration started.
Updating database.
Service Bus services starting.
The event viewer logs for Microsoft-Service Bus > Operational has the following errors. Top error received first...
Exception during fabric service creation for container 1, Exception System.ArgumentException: At least one address must be provided if hostEndpoints is non-null
Parameter name: hostEndpoints
at System.Fabric.FabricClient.InitializeFabricClient(SecurityCredentials credential, TimeSpan keepAliveInterval, String[] hostEndpoints)
at System.Fabric.FabricClient..ctor(SecurityCredentials credential, String[] hostEndpoints)
at Microsoft.ServiceBus.Commands.ServiceBusGetCommands.CreateFabricClient()
at Microsoft.ServiceBus.Commands.ServiceBusCommandBase.RegisterWinFabricService(Int64 containerId)
And then:
Service Bus Gateway service failed to start, retry count 1. Exception message: An error occurred creating the configuration section handler for namespacePolicyDataStoreFactory: Could not load file or assembly 'Microsoft.Cloud.Common.AzureStorage, Version=2.1.0.0, Culture=neutral, PublicKeyToken=4fe77f22fa8374f3' or one of its dependencies. The system cannot find the file specified.. Stack Trace: at System.Configuration.BaseConfigurationRecord.CallCreateSection(Boolean inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentConfig, ConfigXmlReader reader, String filename, Int32 line)
at System.Configuration.BaseConfigurationRecord.CreateSectionDefault(String configKey, Boolean getRuntimeObject, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at Microsoft.Cloud.ServiceBus.ServiceRegistryManagerContext.CreateNamespacePolicyDataManager(IComponentSite site)
at Microsoft.Cloud.ServiceBus.ServiceRegistryManagerContext.LoadServices(IComponentSite site)
at Microsoft.Cloud.ServiceBus.Common.Components.ComponentFactoryBase`1.CreateComponent()
at Microsoft.Cloud.HostingModel.ComponentHost.CreateComponent(IComponentFactory componentFactory)
at Microsoft.Cloud.HostingModel.ComponentHost.CreateComponents()
at Microsoft.Cloud.HostingModel.ComponentHost.Open()
at Microsoft.ServiceBus.Gateway.Gateway.OnStart(String[] args)
In Services the relevant services have the following statuses:
Service Bus Gateway: Starting
Service Bus Message Broker: Stopped
Service Bus Resource Provider: Stopped
Thanks

If you received this error after updating to NET framework v4.6+ then
Microsoft have a fix for this now, download this Update for Service Bus Server 1.1 (KB3086798) http://www.microsoft.com/en-us/download/details.aspx?id=49496

TL;DR;
Download dropbox.com/s/cb5fro1rv... - thanks Arash Rahimi
Navigate to your SDK tools
sn -Vr Microsoft.Cloud.Common.AzureStorage.dll
gacutil /i Microsoft.Cloud.Common.AzureStorage.dll
This issue was caused by installing the Visual Studio 2015 RC. Thankfully someone else has already experienced this and an answer has been posted.
Please see this answer on How do I report a bug in Windows Server Service Bus?
For whatever reason if the Dropbox link becomes obsolete. I have added it to Github.

Make sure any/all RabbitMQ service(s) are all stopped. (Or anything that uses the AMQP protocol)

Related

ASP.Net Core 3.1 Error Load Azure Key Vault On Azure App Service

I Use ASP.Net Core 3.1 and I deploy it on Azure App Service (Web) On Linux.
the question is, when i deploy the code on Azure App Service, i got error message:
Unhandled exception. System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at Microsoft.Azure.KeyVault.KeyVaultClient.GetSecretsWithHttpMessagesAsync(String vaultBaseUrl, Nullable`1 maxresults, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.KeyVault.KeyVaultClientExtensions.GetSecretsAsync(IKeyVaultClient operations, String vaultBaseUrl, Nullable`1 maxresults, CancellationToken cancellationToken)
at Microsoft.Extensions.Configuration.AzureKeyVault.AzureKeyVaultConfigurationProvider.LoadAsync()
at Microsoft.Extensions.Configuration.AzureKeyVault.AzureKeyVaultConfigurationProvider.Load()
at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at ZHFSoftware.Program.Main(String[] args) in / home / runner / work / ZHFSoftware / ZHFSoftware / ZHFSoftware / Program.cs:line 19
ptrace(ATTACH, 29) FAILED Operation not permitted
i know this is PERMISSION error related.
and when i run the web,
:( Application Error
If you are the application administrator, you can access the diagnostic resources.
i can run the code in DEVELOPMENT and PRODUCTION, but on LOCALHOST (and i can get the azure key vault)
but NOT in the Deploy version.
(https://.azurewebsites.net/) => Got Error
i already set the permission based on the manual :
https://learn.microsoft.com/en-us/azure/key-vault/managed-identity
https://learn.microsoft.com/en-us/azure/azure-app-configuration/howto-integrate-azure-managed-service-identity?tabs=core2x
https://wakeupandcode.com/key-vault-for-asp-net-core-3-1-web-apps/
and i follow the youtube manual:
https://www.youtube.com/watch?v=k2VYcYS3EIA
but no use. still error.
Any help will appreciated.
thanks.
Today, i solved my problem.
i "Publish" my web project from Visual Studio 2019 Preview.
and Configure "Service Dependencies", and then Publish.
MY Website Running ...
i push to my github and found this item added.
"serviceDependencies. - Web Deploy.json"
and i open the file, it contains:
{
"dependencies": {
"secrets1": {
"resourceId": "/subscriptions/<subscriptionId>/resourceGroups/<resGroudId>/providers/Microsoft.KeyVault/vaults/<Key Vault Name>",
"type": "secrets.keyVault",
"connectionId": "ASPNETCORE_HOSTINGSTARTUP__KEYVAULT__CONFIGURATIONVAULT"
}
}
}
NB: the Manual from
https://learn.microsoft.com/en-us/azure/spring-cloud/spring-cloud-github-actions-key-vault very useful. thanks Microsoft ^^/

Microsoft.Azure.ServiceFabric.Extension.Core.AgentException: Unable to send node information

I am trying to use terraform to create a Service Fabric Cluster via combination of VMSS, VNETs, NSGs, etc. Unfortunately there isn't an official terraform provider for service fabric, so I am using an ARM template via azurerm_template_deployment.
All resources get created successfully via terraform apply and I am able to RDP into one of the VMs in the scale set. Unfortunately, even after 30-60 minutes, the Azure Portal for Service Fabric resource Status reads Waiting for nodes with no nodes showing up in the table.
When I RDP into the VM, I see several warning/error events in Event Viewer. All events come from ServiceFabricNodeBootstrapAgent:
1.
Info: Bootstrapping local node
2.
Info: PUT https://westus.servicefabric.azure.com/runtime/clusters/GUID_redacted/nodes/node_name_redacted
{"nodeTypeRef":"fronend","ipAddress":"192.168.0.8","faultDomain":"fd:/4","upgradeDomain":"4"}
3. Info
Using client certificate: [Version]
V3
[Subject]
CN=AzureServiceFabric-AnonymousClient
Simple Name: AzureServiceFabric-AnonymousClient
DNS Name: AzureServiceFabric-AnonymousClient
[Issuer]
CN=AzureServiceFabric-AnonymousClient
Simple Name: AzureServiceFabric-AnonymousClient
DNS Name: AzureServiceFabric-AnonymousClient
... etc ...
4.
ERROR: System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.Azure.ServiceFabric.Extension.Core.RestClient.Invoke(Uri requestUri, String method, String requestBody, X509Certificate2 clientCertificate)
5.
System.Exception: System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.Azure.ServiceFabric.Extension.Core.RestClient.Invoke(Uri requestUri, String method, String requestBody, X509Certificate2 clientCertificate)
at Microsoft.Azure.ServiceFabric.Extension.Core.RestClient.Invoke(Uri requestUri, String method, String requestBody, List`1 clientCertificates)
at Microsoft.Azure.ServiceFabric.Extension.Core.RestClient.Invoke(Uri requestUri, String method, String requestBody, List`1 clientCertificates)
at Microsoft.Azure.ServiceFabric.Extension.Core.WrpTopologyService.UpdateNodeInfo(String machineName, NodeDescription nodeDescription)
at System.Threading.Tasks.Task.Execute()
6.
ERROR: Microsoft.Azure.ServiceFabric.Extension.Core.AgentException: Unable to send node information
at Microsoft.Azure.ServiceFabric.Extension.Core.NodeBootstrapAgent.<RunOnce>d__11.MoveNext()
It seems that ServiceFabricNodeBootstrapAgent, a Windows service gets installed, but that's it. None of the service fabric runtime services ever get installed and I am not sure even why that API is used, or why it is returning 401. Anyone out there seen this problem?
Creating a cluster from the marketplace as well as via exported ARM template with powershell works just fine.

Azure Cloud Service (Classic) Roles do not start when I have Swashbuckle and ANY implementation of IOperationFilter

We have an asp.net web api project deployed to an Azure Cloud Service (classic) that has been running fine using Swashbuckle for almost a year. We configure it like so...
GlobalConfiguration.Configuration
.EnableSwagger(c =>
{
c.SingleApiVersion("v1", "PartnerAPI");
c.UseFullTypeNameInSchemaIds();
}).EnableSwaggerUi(c => { });
Recently we needed to tweak the swagger generated output by plugging in an IOperationFilter. However our Azure Cloud Service (Classic) instance will not start if we create a class that implements the IOperationFilter. We don't even try to configure Swagger to use it. Just the fact that there is a class that implements that interface in our solution causes the deploy to fail stating...
2016-12-29T16:10:26.1066042Z ##[error]BadRequest : Your role instances have recycled a number of times during an update or upgrade operation. This indicates that the new version of your service or the configuration settings you provided when configuring the service prevent the role instances from running. Verify your code does not throw unhandled exceptions and that your configuration settings are correct and then start another update or upgrade operation.
Some Notes:
Everything runs fine on my machine, directly and in the azure emulator
Everything runs fine on teammates machine same as above
The following message appears to be related in the event logs on the azure machine when I rdp into it.
File Server Resource Manager was unable to access the following file or volume: 'E:'. This file or volume might be locked by another application right now, or you might need to give Local System access to it.
Same problem in Swashbuckle versions 5 and 5.5
No new nuget packages or references to the project
Only a "using Swashbuckle.Swagger;' that was added to the SwaggerConfig.cs
The Azure Portal reports the following for the "Instance Status Message"...
[12/29T16:43Z]Failed to load role entrypoint. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.Assembly.GetTypes() at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly) --- End of inner exception stack trace --- at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly) at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CreateRoleEntryPoint(RoleType roleTypeEnum) at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)' Last exit time: [2016/12/29, 16:43:59.525]. Last exit code: 0.

Azure App Service: using PerformanceCounters

I am trying to setup my Azure Web App to include the use of a third party software, which seems to require access to PerformanceCounters. Locally this works fine, but when I run it in Azure I get the following error:
[UnauthorizedAccessException: Access to the registry key 'Global' is denied.]
Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) +5230217
Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity) +11769029
Microsoft.Win32.RegistryKey.GetValue(String name) +40
System.Diagnostics.PerformanceMonitor.GetData(String item) +102
System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item) +186
System.Diagnostics.PerformanceCounterLib.get_CategoryTable() +105
System.Diagnostics.PerformanceCounterLib.GetCategorySample(String category) +17
System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) +61
System.Diagnostics.PerformanceCounterCategory.GetCounterInstances(String categoryName, String machineName) +70
System.Diagnostics.PerformanceCounterCategory.GetInstanceNames() +25
According to this answer, I should configure IIS to allow access to the app pool/user, but I don't think that is possible for a Azure Web App. Is there a way to get performance counters working in my situation?
On Windows, Performance Counters are accessible through WMI:
https://msdn.microsoft.com/en-us/library/aa392397(v=vs.85).aspx
WMI is restricted in the App Service sandbox.
From https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#access-to-out-of-process-com-servers:
Access to out-of-process COM servers
Windows Servers have a bunch of COM servers configured and available for consumption by default; however the sandbox prevents access to all out-of-proc COM servers. For example, a sandboxed application cannot call into WMI, or into MSIServer.
From Kudu:
PS D:\home> Get-Counter -Counter "\processor(_total)\% processor time"
Get-Counter : The specified object was not found on the computer.
PS D:\home> Get-WmiObject -Class WIN32_OperatingSystem
Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005
(E_ACCESSDENIED))
If you absolutely have to use the 3rd party software, look at Azure Cloud Services (with a Web Role). You have full control over the OS there while still being PaaS.

Azure worker role hangs on publish with error in Diagnostics

After updating to Azure SDK 2.6 (from 2.5.1) I have not been able to publish my Azure Worker Role instance. It had been working previously with the 2.5.1 SDK. The worker process fails to start in Azure and hangs with the status of:
Busy (Waiting for role to start... Application startup tasks are running. [2015- 06-02T23:27:56Z] Last role error: exit code - 0, exit time - [2015/06/02, 23:27:20.218])
The worker process does make use of Azure Diagnostics - configured in my service definition file like:
<Imports>
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
<Import moduleName="Diagnostics"/>
</Imports>
and I do see an error in the Event Log of the worker VM:
System.UnauthorizedAccessException: Access to the path 'DiagnosticPlugin-ShutdownEvent' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Threading.EventWaitHandle..ctor(Boolean initialState, EventResetMode mode, String name)
at Microsoft.WindowsAzure.Plugins.Launcher.Program.MainImpl(String[] args)
at Microsoft.WindowsAzure.Plugins.Launcher.Program.Main(String[] args)
I'm just not sure how to correct the issue. Any ideas?
Azure Diagnostics Module should no longer be present in either SDK 2.5 or 2.6 of Azure deployments. Azure Diagnostics in SDK2.5+ world is now configured as an extension. (Diagnostics v1.3 version)
Here is more information: https://azure.microsoft.com/en-us/documentation/articles/cloud-services-dotnet-diagnostics/

Resources